package nc.gk.gkxm.controller.api;

import io.swagger.annotations.Api;
import nc.gk.gkxm.service.GenerateQuesttionService;
import nc.gk.gkxm.utils.Result;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 生成题库
 */
@RestController
@Api(tags = "生成题库")
@RequestMapping("/gkxm/api/generateQuestion")
public class GenerateQuesttionController{
    @Resource
    private GenerateQuesttionService generateQuesttionService;

    /**
     * 根据用户所选择的类型生成对应的题库
     * @param token
     * @param map   sortIds为类型id集合
     * @return
     */
    @PostMapping("/getGenerateQuestion")
    public Result getGenerateQuestion(@RequestHeader("token") String token,@RequestBody Map<String,Object> map) {

        String result=generateQuesttionService.getQuestionInfo(token,map);

        return Result.ok(result);
    }

}
